#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#

# def test(v1, v2):
#     print(v1, v2)

# test(3, 5)


# def local(v1, status=False):
#     return v1 if status else "木有状态"


# print(local("hello"))

# def the_test(v1, status=False, v2):     # non-default argument follows default argument
#     return v1 if status else "木有状态"

# def the_test(v1, v2, v1):               # duplicate argument 'v1' in function definition
#     return v1 if v2 else "木有状态"

"""
def test(x, y, *args):
    print("x: {} \ny: {} \nargs: {}".format(x, y, args))


test(1, 2, 3, 4, 5, 6, 7, 8)  # args: (3, 4, 5, 6, 7, 8)

# 如果不做处理，那么传递的就是一个元组加列表的形式
test(1, 2, [1, 2], [111, 22])  # args: ([1, 2], [111, 22])

# 通过 *[] 类似于迭代直接列表做了一个for循环传递到*args当中
test(1, 2, *[1, 2, 3, 5, 6])  # args: (1, 2, 3, 5, 6)



def test(x, **kwargs):
    print("x: {} \nkwargs: {}".format(x, kwargs))


# kwargs: {'k': '123', 'k2': '234', 'k3': '345', 'k4': '456'}
test(1, k="123", k2="234", k3="345", k4="456")

# 通过迭代的方式传递，先解开然后在传值， 如果直接传字典会报错
test(1, **{'k': '123', 'k2': '234', 'k3': '345', 'k4': '456'})
"""


def test(*args, **kwargs):
    print("args: {}\nkwargs: {}".format(args, kwargs))


# args: (1, 2, 3) kwargs: {'k': '123', 'k2': '234'}
test(1, 2, 3, k="123", k2="234")

# args: (1, 2, 3) kwargs: {'k': '123', 'k2': '234'}
test(*[1, 2, 3], **{'k': '123', 'k2': '234'})
